package lew.bing.exp.guava;

import com.google.common.util.concurrent.ListenableFuture;
import com.google.common.util.concurrent.ListenableFutureTask;
import com.google.common.util.concurrent.MoreExecutors;

import java.util.concurrent.Executors;

/**
 * Created by 刘国兵 on 2018/10/1.
 */
public class TestFuture {

    public static void main(String[] args) {
        ListenableFutureTask<Integer> task = ListenableFutureTask.create(() -> {
            return 2;
        });

        ListenableFuture<Integer> submit = MoreExecutors.listeningDecorator(Executors.newCachedThreadPool()).submit(() -> {
            return 2;
        });


    }

}
